import { getUserInfo as getUserInfoApi } from "../../api/user";
export const getUserInfo = () => {
  return async dispatch => {
    // 异步请求
    try {
      let { data } = await getUserInfoApi();
      dispatch({ type: "userInfo", payload: {...data} });
    } catch (error) {
      console.log(error);
    }
  };
};
